/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.Beans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Bone
 */
@Entity
@Table(name = "contabil_historico")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ContabilHistorico.findAll", query = "SELECT c FROM ContabilHistorico c")})
public class ContabilHistorico implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer id;
    @Column(length = 100)
    private String descricao;
    @Column(length = 250)
    private String historico;
    @Column(name = "PEDE_COMPLEMENTO")
    private Character pedeComplemento;
    @OneToMany(mappedBy = "idContabilHistorico")
    private List<ContabilLancaProgramadoDet> contabilLancaProgramadoDetList;
    @JoinColumn(name = "ID_EMPRESA", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false)
    private Empresa idEmpresa;
    @OneToMany(mappedBy = "idContabilHistorico")
    private List<ContabilLancamentoDetalhe> contabilLancamentoDetalheList;

    public ContabilHistorico() {
    }

    public ContabilHistorico(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public String getHistorico() {
        return historico;
    }

    public void setHistorico(String historico) {
        this.historico = historico;
    }

    public Character getPedeComplemento() {
        return pedeComplemento;
    }

    public void setPedeComplemento(Character pedeComplemento) {
        this.pedeComplemento = pedeComplemento;
    }

    @XmlTransient
    public List<ContabilLancaProgramadoDet> getContabilLancaProgramadoDetList() {
        return contabilLancaProgramadoDetList;
    }

    public void setContabilLancaProgramadoDetList(List<ContabilLancaProgramadoDet> contabilLancaProgramadoDetList) {
        this.contabilLancaProgramadoDetList = contabilLancaProgramadoDetList;
    }

    public Empresa getIdEmpresa() {
        return idEmpresa;
    }

    public void setIdEmpresa(Empresa idEmpresa) {
        this.idEmpresa = idEmpresa;
    }

    @XmlTransient
    public List<ContabilLancamentoDetalhe> getContabilLancamentoDetalheList() {
        return contabilLancamentoDetalheList;
    }

    public void setContabilLancamentoDetalheList(List<ContabilLancamentoDetalhe> contabilLancamentoDetalheList) {
        this.contabilLancamentoDetalheList = contabilLancamentoDetalheList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ContabilHistorico)) {
            return false;
        }
        ContabilHistorico other = (ContabilHistorico) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bs.Beans.ContabilHistorico[ id=" + id + " ]";
    }
    
}
